<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="template.xhtml">
    <ui:define name="content">
        <div class="container">
            <h:form id="newUserForm">
                <div style="text-align: center">
                    <h:panelGrid id="inputGrid" cellpadding="5" style="margin: 0 auto; text-align: left" columns="1">
                        <p:messages globalOnly="true" showIcon="true"/>
                        <p:inputText style="width:272px" id="firstName" placeholder="First name"
                                     value="#{registerUserBean.firstName}" required="true"/>
                        <p:inputText style="width:272px" id="lastName" placeholder="Last name"
                                     value="#{registerUserBean.lastName}" required="true"/>
                        <p:inputText style="width:272px" placeholder="Email" type="email" id="email"
                                     value="#{registerUserBean.email}"
                                     required="true"/>
                        <p:inputText style="width:272px" placeholder="Re-enter Email" type="email" id="re-enter-email"
                                     value="#{registerUserBean.emailVerify}" required="true"/>
                        <p:password style="width:272px" id="password" placeholder="Password"
                                    value="#{registerUserBean.password}"
                                    required="true"/>
                        <p:selectOneRadio id="sex" value="#{registerUserBean.sex}" required="true">
                            <f:selectItem itemLabel="Male" itemValue="M"/>
                            <f:selectItem itemLabel="Female" itemValue="F"/>
                        </p:selectOneRadio>
                        <p:outputPanel>
                            <p:selectOneMenu id="year" value="#{registerUserBean.year}" required="true">
                                <f:selectItem itemLabel="Year" noSelectionOption="true"/>
                                <f:selectItems value="#{registerUserBean.years}"/>
                            </p:selectOneMenu>
                            <p:selectOneMenu id="month" value="#{registerUserBean.month}" required="true">
                                <f:selectItem itemLabel="Month" noSelectionOption="true"/>
                                <f:selectItem itemLabel="Januari" itemValue="1"/>
                                <f:selectItem itemLabel="Februari" itemValue="2"/>
                                <f:selectItem itemLabel="March" itemValue="3"/>
                                <f:selectItem itemLabel="April" itemValue="4"/>
                                <f:selectItem itemLabel="May" itemValue="5"/>
                                <f:selectItem itemLabel="June" itemValue="6"/>
                                <f:selectItem itemLabel="July" itemValue="7"/>
                                <f:selectItem itemLabel="August" itemValue="8"/>
                                <f:selectItem itemLabel="September" itemValue="9"/>
                                <f:selectItem itemLabel="October" itemValue="10"/>
                                <f:selectItem itemLabel="November" itemValue="11"/>
                                <f:selectItem itemLabel="December" itemValue="12"/>
                            </p:selectOneMenu>
                            <p:selectOneMenu id="day" value="#{registerUserBean.day}" required="true">
                                <f:selectItem itemLabel="Day" noSelectionOption="true"/>
                                <f:selectItems value="#{registerUserBean.daysOfMonth}"/>
                            </p:selectOneMenu>
                        </p:outputPanel>
                        <p:commandButton value="Sign up" action="#{registerUserBean.register()}" update="inputGrid"/>
                    </h:panelGrid>
                </div>
            </h:form>
        </div>
    </ui:define>
</ui:composition>
</html>
